OPC_MOTOR_STATUS_VERSION       := 0.0.1
OPC_MOTOR_STATUS_SITE          := package/opc-motor-status/src
OPC_MOTOR_STATUS_SITE_METHOD   := local
OPC_MOTOR_STATUS_LICENSE       := BSD-3c
OPC_MOTOR_STATUS_LICENSE_FILES := COPYING
OPC_MOTOR_STATUS_DEPENDENCIES  := libopen62541
OPC_MOTOR_STATUS_START_AT_BOOT := false

ifeq ($(OPC_MOTOR_STATUS_START_AT_BOOT),true)
define OPC_MOTOR_STATUS_INSTALL_INIT_SCRIPT
	install -Dm0755 $(@D)/S95opcua $(TARGET_DIR)/etc/init.d/S95opcua
endef
endif

define OPC_MOTOR_STATUS_BUILD_CMDS
	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) \
		CFLAGS+="-I$(STAGING_DIR)/usr/include" \
		LDFLAGS+="-L$(STAGING_DIR)/usr/lib"
endef

define OPC_MOTOR_STATUS_INSTALL_TARGET_CMDS
	DESTDIR=$(TARGET_DIR) $(MAKE) -C $(@D) install;
	$(OPC_MOTOR_STATUS_INSTALL_INIT_SCRIPT)
endef

$(eval $(generic-package))
